﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SelectLevelControl : MonoBehaviour
{
	public Text tCoin;
	public static SelectLevelControl instance;
	public GameObject shopPopup;

	void Awake ()
	{
		instance = this;
	}

	void Start ()
	{
		GameManager.gameState = GameState.SELECT_LEVEL;
		if (AudioManager.instance.AS_MUSIC.clip != AudioManager.instance.audioDic [AudioClipType.overture]) {
			AudioManager.instance.PlayMusic (AudioClipType.overture);
		}
	}

	void OnEnable ()
	{
		UpdateCoinText ();
	}

	public void UpdateCoinText ()
	{
		tCoin.text = "$ " + GameManager.dataSave.coin;
	}


	public void MenuClick ()
	{
		Time.timeScale = 1;
		LoadSceneFading.LoadScene ("scn_menu");
	}

	public void ShowShop ()
	{
		shopPopup.SetActive (true);
	}
}
